home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.11 Nov 91 / Icon List source / CObject.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-21  |  901 b   |  42 lines  |  [TEXT/KAHL]

  1. /* •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  2.  
  3.                             The root-level Object Class
  4.     
  5.         Abstract class which is at the root of the class hierarchy. CObject
  6.         is the only class which does not have a superclass.    
  7.  
  8.     SUPERCLASS = None
  9.     
  10.     Copyright © 1989 Symantec Corporation. All rights reserved.
  11.     
  12.     Modified by Rob, 900116
  13.  
  14.     ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• */
  15.  
  16. #include <oops.h>
  17. #include "CObject.h"
  18.  
  19. /* •••••••••• base object •••••••••• */
  20.  
  21. /******************************
  22.  *
  23.  *        Dispose - Dispose of an object by freeing the block of memory it occupies
  24.  */
  25. void    CObject::Dispose()
  26.     {
  27.     delete ( this );
  28.     }
  29.  
  30.  
  31. /******************************
  32.  *
  33.  *        Copy - make a copy of an object.
  34.  */
  35.  CObject*    CObject::Copy()
  36.     {
  37.     Handle        copyOfObject;
  38.     
  39.     copyOfObject = (Handle) this;
  40.     HandToHand ( ©OfObject );
  41.     return ( (CObject*) copyOfObject );
  42.     }